package coml.jiyun.hp.wanandroid.ui.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import java.util.List;

import coml.jiyun.hp.wanandroid.FlowLayout;
import coml.jiyun.hp.wanandroid.R;
import coml.jiyun.hp.wanandroid.base.BaseRlvAdapter;
import coml.jiyun.hp.wanandroid.bean.SystemBean;

public class FlowSystemAdapter extends BaseRlvAdapter<SystemBean.DataBean> {

    public FlowSystemAdapter(Context context, List<SystemBean.DataBean> list) {
        super(context, list);
    }

    @Override
    protected void bindData(BaseViewHolder holder, SystemBean.DataBean dataBean) {
        FlowLayout fl = (FlowLayout) holder.itemView;
        List<SystemBean.DataBean.ChildrenBean> dataBeans = dataBean.getChildren();

        for (int i = 0; i < dataBeans.size() ; i++) {
            SystemBean.DataBean.ChildrenBean childrenBean = dataBeans.get(i);
            TextView tv = (TextView) LayoutInflater.from(mContext).inflate(R.layout.item_flow_system, null);
            tv.setText(childrenBean.getName());
            fl.addView(tv);
        }
    }

    @Override
    protected int getLayout() {
        return R.layout.item_navi;
    }
}
